When using the code below we get the following error "-E- DXL: <Line:5> Incorrect argument for function (realOf)". Can anyone tell me what is wrong with line 5? real calcCost(Object o){ real rAccCost = 0.0 Object objChild = null for objChild in o do { rAccCost += realOf(objChild."Cost") rAccCost += calcCost(objChild) } return rAccCost } real r = calcCost(obj) if(r > 0.0) obj.attrDXLName = r Tap5 - Wed Apr 09 15:21:10 EDT 2014 |
Re: realOf error "incorrect argument" Suffix the attribute with a blank string, that I think should do the trick. So your fifth line should be: rAccCost += realOf(objChild."Cost" "") |
Re: realOf error "incorrect argument" SudarshanRao - Thu Apr 10 03:38:09 EDT 2014 Suffix the attribute with a blank string, that I think should do the trick. So your fifth line should be: rAccCost += realOf(objChild."Cost" "") Yes. Discussion:
It is indeed confusing. In general, routinely use double quotes after o.NameAttr to make it work; except during assignment statments. -Louie |